package com.kmg.scart.model;

import java.util.HashSet;
import java.util.Set;

public class Product extends ApplicationEntity{


	private String description;
	
	private String shortName;
	
	private Double price;
	
	private ProductDetails details;
	
	private Set<ProductCategory> categories;
	
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<ProductCategory> getCategories() {
		return categories;
	}

	public void setCategories(Set<ProductCategory> categories) {
		this.categories = categories;
	}
	
	public void assignCategory(ProductCategory category){
		if(categories ==null){
			categories = new HashSet<ProductCategory>();
		}
		categories.add(category);
	}

	public ProductDetails getDetails() {
		return details;
	}

	public void setDetails(ProductDetails details) {
		this.details = details;
	}
	
	public void addDetails(ProductDetails details){
		details.id=this.id;
		this.details= details;
	}
}
